3.9 \(\int x (a+b \tan (c+d x^2))^2 \, dx\)

Optimal. Leaf size=51 \[ \frac {1}{2} x^2 \left (a^2-b^2\right )-\frac {a b \log \left (\cos \left (c+d x^2\right )\right )}{d}+\frac {b^2 \tan \left (c+d x^2\right )}{2 d} \]

[Out]

1/2*(a^2-b^2)*x^2-a*b*ln(cos(d*x^2+c))/d+1/2*b^2*tan(d*x^2+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {3747, 3477, 3475} \[ \frac {1}{2} x^2 \left (a^2-b^2\right )-\frac {a b \log \left (\cos \left (c+d x^2\right )\right )}{d}+\frac {b^2 \tan \left (c+d x^2\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[x*(a + b*Tan[c + d*x^2])^2,x]

[Out]

((a^2 - b^2)*x^2)/2 - (a*b*Log[Cos[c + d*x^2]])/d + (b^2*Tan[c + d*x^2])/(2*d)

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3477

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[(a^2 - b^2)*x, x] + (Dist[2*a*b, Int[Tan[c + d
*x], x], x] + Simp[(b^2*Tan[c + d*x])/d, x]) /; FreeQ[{a, b, c, d}, x]

Rule 3747

Int[(x_)^(m_.)*((a_.) + (b_.)*Tan[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Tan[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[
(m + 1)/n], 0] && IntegerQ[p]

Rubi steps

\begin {align*} \int x \left (a+b \tan \left (c+d x^2\right )\right )^2 \, dx &=\frac {1}{2} \operatorname {Subst}\left (\int (a+b \tan (c+d x))^2 \, dx,x,x^2\right )\\ &=\frac {1}{2} \left (a^2-b^2\right ) x^2+\frac {b^2 \tan \left (c+d x^2\right )}{2 d}+(a b) \operatorname {Subst}\left (\int \tan (c+d x) \, dx,x,x^2\right )\\ &=\frac {1}{2} \left (a^2-b^2\right ) x^2-\frac {a b \log \left (\cos \left (c+d x^2\right )\right )}{d}+\frac {b^2 \tan \left (c+d x^2\right )}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.20, size = 75, normalized size = 1.47 \[ \frac {2 b^2 \tan \left (c+d x^2\right )-i \left ((a+i b)^2 \log \left (-\tan \left (c+d x^2\right )+i\right )-(a-i b)^2 \log \left (\tan \left (c+d x^2\right )+i\right )\right )}{4 d} \]

Antiderivative was successfully verified.

[In]

Integrate[x*(a + b*Tan[c + d*x^2])^2,x]

[Out]

((-I)*((a + I*b)^2*Log[I - Tan[c + d*x^2]] - (a - I*b)^2*Log[I + Tan[c + d*x^2]]) + 2*b^2*Tan[c + d*x^2])/(4*d
)

________________________________________________________________________________________

fricas [A]  time = 0.58, size = 51, normalized size = 1.00 \[ \frac {{\left (a^{2} - b^{2}\right )} d x^{2} - a b \log \left (\frac {1}{\tan \left (d x^{2} + c\right )^{2} + 1}\right ) + b^{2} \tan \left (d x^{2} + c\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*tan(d*x^2+c))^2,x, algorithm="fricas")

[Out]

1/2*((a^2 - b^2)*d*x^2 - a*b*log(1/(tan(d*x^2 + c)^2 + 1)) + b^2*tan(d*x^2 + c))/d

________________________________________________________________________________________

giac [A]  time = 0.71, size = 53, normalized size = 1.04 \[ \frac {{\left (d x^{2} + c\right )} a^{2} - {\left (d x^{2} + c - \tan \left (d x^{2} + c\right )\right )} b^{2} - 2 \, a b \log \left ({\left | \cos \left (d x^{2} + c\right ) \right |}\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*tan(d*x^2+c))^2,x, algorithm="giac")

[Out]

1/2*((d*x^2 + c)*a^2 - (d*x^2 + c - tan(d*x^2 + c))*b^2 - 2*a*b*log(abs(cos(d*x^2 + c))))/d

________________________________________________________________________________________

maple [A]  time = 0.02, size = 72, normalized size = 1.41 \[ \frac {\arctan \left (\tan \left (d \,x^{2}+c \right )\right ) a^{2}}{2 d}-\frac {\arctan \left (\tan \left (d \,x^{2}+c \right )\right ) b^{2}}{2 d}+\frac {a b \ln \left (1+\tan ^{2}\left (d \,x^{2}+c \right )\right )}{2 d}+\frac {b^{2} \tan \left (d \,x^{2}+c \right )}{2 d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a+b*tan(d*x^2+c))^2,x)

[Out]

1/2/d*arctan(tan(d*x^2+c))*a^2-1/2/d*arctan(tan(d*x^2+c))*b^2+1/2/d*a*b*ln(1+tan(d*x^2+c)^2)+1/2*b^2*tan(d*x^2
+c)/d

________________________________________________________________________________________

maxima [B]  time = 0.43, size = 149, normalized size = 2.92 \[ \frac {1}{2} \, a^{2} x^{2} - \frac {{\left (d x^{2} \cos \left (2 \, d x^{2} + 2 \, c\right )^{2} + d x^{2} \sin \left (2 \, d x^{2} + 2 \, c\right )^{2} + 2 \, d x^{2} \cos \left (2 \, d x^{2} + 2 \, c\right ) + d x^{2} - 2 \, \sin \left (2 \, d x^{2} + 2 \, c\right )\right )} b^{2}}{2 \, {\left (d \cos \left (2 \, d x^{2} + 2 \, c\right )^{2} + d \sin \left (2 \, d x^{2} + 2 \, c\right )^{2} + 2 \, d \cos \left (2 \, d x^{2} + 2 \, c\right ) + d\right )}} + \frac {a b \log \left (\sec \left (d x^{2} + c\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*tan(d*x^2+c))^2,x, algorithm="maxima")

[Out]

1/2*a^2*x^2 - 1/2*(d*x^2*cos(2*d*x^2 + 2*c)^2 + d*x^2*sin(2*d*x^2 + 2*c)^2 + 2*d*x^2*cos(2*d*x^2 + 2*c) + d*x^
2 - 2*sin(2*d*x^2 + 2*c))*b^2/(d*cos(2*d*x^2 + 2*c)^2 + d*sin(2*d*x^2 + 2*c)^2 + 2*d*cos(2*d*x^2 + 2*c) + d) +
 a*b*log(sec(d*x^2 + c))/d

________________________________________________________________________________________

mupad [B]  time = 3.24, size = 52, normalized size = 1.02 \[ x^2\,\left (\frac {a^2}{2}-\frac {b^2}{2}\right )+\frac {b^2\,\mathrm {tan}\left (d\,x^2+c\right )}{2\,d}+\frac {a\,b\,\ln \left ({\mathrm {tan}\left (d\,x^2+c\right )}^2+1\right )}{2\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a + b*tan(c + d*x^2))^2,x)

[Out]

x^2*(a^2/2 - b^2/2) + (b^2*tan(c + d*x^2))/(2*d) + (a*b*log(tan(c + d*x^2)^2 + 1))/(2*d)

________________________________________________________________________________________

sympy [A]  time = 0.21, size = 65, normalized size = 1.27 \[ \begin {cases} \frac {a^{2} x^{2}}{2} + \frac {a b \log {\left (\tan ^{2}{\left (c + d x^{2} \right )} + 1 \right )}}{2 d} - \frac {b^{2} x^{2}}{2} + \frac {b^{2} \tan {\left (c + d x^{2} \right )}}{2 d} & \text {for}\: d \neq 0 \\\frac {x^{2} \left (a + b \tan {\relax (c )}\right )^{2}}{2} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*tan(d*x**2+c))**2,x)

[Out]

Piecewise((a**2*x**2/2 + a*b*log(tan(c + d*x**2)**2 + 1)/(2*d) - b**2*x**2/2 + b**2*tan(c + d*x**2)/(2*d), Ne(
d, 0)), (x**2*(a + b*tan(c))**2/2, True))

________________________________________________________________________________________